package back;

import dao.ITheme;
import java.io.Serializable;
import java.util.Map;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.enterprise.context.ApplicationScoped;
import javax.faces.bean.ManagedBean;

@ManagedBean(name = "theme")
@ApplicationScoped
public class ThemeBean implements Serializable{
    
    @EJB
    ITheme t;

    private Map<String, String> themes;
    private String theme;
    
    
    public Map<String, String> getThemes() {
        return themes;
    }

    public String getTheme() {
        return theme;
    }
    
    @PostConstruct
    public void init(){
        theme = t.getTheme();
        themes = t.getThemes();
    }

    public void setTheme(String theme) {
        this.theme = theme;
    }
    
    public void saveTheme(){
        t.setTheme(theme);
    }
    
}